<#include "../common/layout/__mainlayout.html">
<#include "../common/__pagination.html">

<!-- page specific plugin styles -->
        <!--设置面包屑-->
        <#assign pageBreadCrumbs>
            <li class="active"><a href="#">消息推送管理</a></li>
            <li class="active">编辑</li>
        </#assign>


        <#assign pageCss>
            <!-- page specific plugin styles -->
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/jquery-ui.custom.css"/>
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/chosen.css"/>
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/datepicker.css"/>
            <link rel="stylesheet" href="${ctx}/static/admin/assets/css/bootstrap-timepicker.css" />
        </#assign>

        <#assign pageJavascript>
        <script src="${ctx}/static/admin/assets/js/jquery.dataTables.js"></script>
        <script src="${ctx}/static/admin/assets/js/jquery.dataTables.bootstrap.js"></script>
        <script src="${ctx}/static/admin/assets/js/ajaxfileupload.js"></script>
        <script src="${ctx}/static/admin/assets/js/bootstrap-wysiwyg.js"></script>

        <script type="text/javascript">
            var $path_assets = "${ctx}/static/admin/assets/";//this will be used in loading jQuery UI if needed!
        </script>
        <script type="text/javascript">

        </script>

        <script type="text/javascript">

            $(document).ready(function(){

                $('#isLoopPush').val(${notify.isLoopPush!});
                $('#loopCycle').val(${notify.loopCycle!});
                $('#msgShowType').val(${notify.msgShowType!});
                $('#isFullScreen').val(${notify.isFullScreen!});
                $('#msgObj').val(${notify.msgObj!});
                msgObj = $('#msgObj').val();
                showDiv = "";
                if(msgObj ==2) {
                    showDiv = "softDiv";
                } else if(msgObj ==3){
                    showDiv = "topicDiv";
                }else if(msgObj ==4){
                    //分类处理
                    showDiv = "categoryDiv";
                }else if(msgObj ==5) {
                    showDiv = "linkUrlDiv";
                }
                if(""!=showDiv)$("#" + showDiv).show();

                $('#pushTimePoint').timepicker({
                    minuteStep: 1,
                    showSeconds: false,
                    showMeridian: false
                }).next().on(ace.click_event, function(){
                    $(this).prev().focus();
                });

                $('.date-picker').datepicker({
                    autoclose: true,
                    todayHighlight: true
                }).next().on(ace.click_event, function(){
                    $(this).prev().focus();
                });


                $("#searchSoftButton").click(function(){
                    var url="${ctx}/admin/soft/searchSoft.do";
                    softId = $("#softId").val();
                    softName = $("#softName").val();
                    //将选中的一级下拉列表项的id传过去
                    $.getJSON(url, {"id": softId,"softName":softName},function (data) {
                        //对请求返回的JSON格式进行分解加载
                        $("#softtbody").empty();
                        $(data).each(function () {
                            content = '<tr></tr><td  align="center"><div class="radio"><label> <input name="softradio" type="radio" class="ace" /> <span class="lbl"> </span></label></div></td>'
                            +'<td  align="center">'+this.id+'</td>'
                            +'<td  align="center">'+this.softName+'</td></tr>'
                            $("#softtbody").append(content);
                        });
                    });
                });


                $("#notifyForm").validate({
                    errorElement: 'div',
                    errorClass: 'help-block',
                    focusInvalid: true,
                    highlight: function (e) {
                        $(e).closest('.form-group').removeClass('has-info').addClass('has-error');
                    },
                    success: function (e) {
                        $(e).closest('.form-group').removeClass('has-error');//.addClass('has-info');
                        $(e).remove();
                    },
                    errorPlacement: function (error, element) {
                        if(element.is('input[type=checkbox]') || element.is('input[type=radio]')) {
                            var controls = element.closest('div[class*="col-"]');
                            if(controls.find(':checkbox,:radio').length > 1) controls.append(error);
                            else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));
                        }
                        else if(element.is('.select2')) {
                            error.insertAfter(element.siblings('[class*="select2-container"]:eq(0)'));
                        }
                        else if(element.is('.chosen-select')) {
                            error.insertAfter(element.siblings('[class*="chosen-container"]:eq(0)'));
                        }
                        else error.insertAfter(element.parent());
                    },

                    submitHandler: function (form) {
                        $.ajax({
                            cache: true,
                            type: "POST",
                            url:"${ctx}/admin/notify/save.do",
                            data:$('#notifyForm').serialize(),// 你的formid
                            async: false,
                            error: function(request) {
                                alert("Connection error");
                            },
                            success: function(data) {
                                if(data.result == "success"){
                                    window.location="${refer!}";
                                }else{
                                    alert(data.messages);
                                }
                            }
                        });
                    },
                    invalidHandler: function (form) {
                    }
                })
            });


            function submitNotify(){
                if($('#msgShowType').val()==1){
                    if($('#iconUrl').val()==""){
                        alert("请上传展示图标");
                        return false;
                    }
                }else{
                    if($('#picUrl').val()==""){
                        alert("请上传banne图地址");
                        return false;
                    }
                }
                $('#notifyForm').submit();
            }


            function changemsgObj(node){
                msgObj = $(node).val();
                showDiv = "softDiv";
                if(msgObj ==2) {
                    resetSoft();
                } else if(msgObj ==3){
                    resetTopic();
                }else if(msgObj ==4){
                    //分类处理
                    resetCatagory();
                }else if(msgObj ==5) {
                    showDiv = "linkUrlDiv";
                }
                divs = new Array("linkUrlDiv","softDiv","categoryDiv","topicDiv");
                for (index in divs) {
                    if (divs[index] == showDiv) {
                        $("#" + divs[index]).show();
                    } else {
                        $("#" + divs[index]).hide();
                    }
                }
            }

            function resetSoft(){
                showDiv = "softDiv";
                var url="${ctx}/admin/soft/searchSoft.do";
                softId = $("#softId").val();
                softName = $("#softName").val();
                //将选中的一级下拉列表项的id传过去
                $.getJSON(url, {"id": softId,"softName":softName,"pageSize":20},function (data) {
                    //对请求返回的JSON格式进行分解加载
                    $("#softtbody").empty();
                    $(data).each(function () {
                        content = '<tr><td><div class="radio"><label> <input name="softradio" type="radio" value="'+this.id+'" class="ace" /> <span class="lbl"> </span></label></div></td>'
                        +'<td>'+this.id+'</td>'
                        +'<td>'+this.softName+'</td></tr>'
                        $("#softtbody").append(content);
                    });
                });
            }



            function resetTopic(){
                showDiv = "topicDiv";
                var url="${ctx}/admin/topic/getTopicList.do";
                topicId = $("#topicId").val();
                topicName = $("#topicName").val();
                //将选中的一级下拉列表项的id传过去
                $.getJSON(url, {"topicId": topicId,"topicName":topicName},function (data) {
                    //对请求返回的JSON格式进行分解加载
                    $("#topictbody").empty();
                    $(data.listData).each(function () {
                        content = '<tr><td><div class="radio"><label> <input name="topicradio" type="radio" value="'+this.id+'" class="ace" /> <span class="lbl"> </span></label></div></td>'
                        +'<td>'+this.id+'</td>'
                        +'<td>'+this.topicName+'</td></tr>';
                        $("#topictbody").append(content);
                    });
                });
            }

            function resetCatagory(){
                showDiv = "categoryDiv";
                var url="${ctx}/admin/category/listCategies.do";
                categoryName = $("#categoryName").val();
                //将选中的一级下拉列表项的id传过去
                $.getJSON(url, {"categoryName": categoryName},function (data) {
                    //对请求返回的JSON格式进行分解加载
                    $("#categorytbody").empty();
                    $(data.data).each(function () {
                        content = '<tr><td><div class="radio"><label> <input name="categoryradio" type="radio" value="'+this.id+'" class="ace" /> <span class="lbl"> </span></label></div></td>'
                        +'<td>'+this.id+'</td>'
                        +'<td>'+this.level+'</td>'
                        +'<td>'+this.categoryName+'</td></tr>'
                        $("#categorytbody").append(content);
                    });
                });
            }



            function changeIsFullScreen(node){
                isFullScreen = $(node).val();
                if(isFullScreen==0){
                    $("#div-fullscreen").hide();
                }else{
                    $("#div-fullscreen").show();
                }
            }

            function uploadFullscreenImgFile(){
                $.blockUI();
                $.ajaxFileUpload({
                    url:"${ctx}/admin/upload/uploadPic.do?inputName=fullscreenImgFile",            //需要链接到服务器地址
                    dataType : 'text',
                    fileElementId:'id-input-fullscreenImg',                        //文件选择框的id属性
                    success: function(data, status){
                        $.unblockUI();
                        msg = jQuery.parseJSON(jQuery(data).text());
                        if(msg.result == "success"){
                            var upload=msg.data;
                            $("#fullScreenImage").val(upload);
                            $("#screenpica").val(upload);
                            $("#screenpicimg").attr("src",upload);
                        }else{
                            alert(msg.messages);
                        }
                    },error: function (data, status, e){
                        $.unblockUI();
                        alert("上传出错，请重新上传");
                    }
                });
            }


            function uploadPicFile(){
                $.blockUI();
                $.ajaxFileUpload({
                    url:"${ctx}/admin/upload/uploadPic.do?inputName=picFile",            //需要链接到服务器地址
                    dataType : 'text',
                    fileElementId:'id-input-pic',                        //文件选择框的id属性
                    success: function(data, status){
                        $.unblockUI();
                        msg = jQuery.parseJSON(jQuery(data).text());
                        if(msg.result == "success"){
                            var upload=msg.data;
                            var msgShowType = $("#msgShowType").val();
                            $("#pica").val(upload);
                            $("#picimg").attr("src",upload);
                            if(msgShowType ==1){
                                $("#iconUrl").val(upload);
                                $("#picUrl").val("");
                            }else{
                                $("#picUrl").val(upload);
                                $("#iconUrl").val("");
                            }
                        }else{
                            alert(msg.messages);
                        }
                    },error: function (data, status, e){
                        $.unblockUI();
                        alert("上传出错，请重新上传");
                    }
                });
            }


            $("#id-input-pic,#id-input-fullscreenImg").ace_file_input({
                no_file:'未选择文件 ...',
                btn_choose:'浏览',
                btn_change:'更改',
                droppable:false,
                onchange:null,
                thumbnail:false //| true | large
                //whitelist:'gif|png|jpg|jpeg'
                //blacklist:'exe|php'
                //onchange:''
                //
            });
        </script>
        </#assign>
    <@mainlayout pageBreadCrumbs=pageBreadCrumbs pageCss=pageCss pageJavascript=pageJavascript currentMenu="ClientFlag-notifyPushFlag">
    <form id="notifyForm" class="form-horizontal" action="${ctx}/admin/soft/save.do" method="post">
        <div class="row">
            <div class="col-sm-12">
                <div class="widget-box">
                    <div class="widget-header">
                        <h4 class="widget-title">推广基础信息</h4>

                    </div>
                    <div class="widget-body">
                        <div class="widget-main">
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="id">消息编号:</label>
                                <div class="col-xs-12 col-sm-4">
                                    <div class="clearfix">
                                        <input type="text" name="id" id="id" class="col-xs-12 " readonly="" value="${notify.id!}"/>
                                    </div>
                                </div>
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="msgTitle">消息标题:</label>
                                <div class="col-sm-4  ">
                                    <div class="clearfix">
                                        <input type="text" name="msgTitle" id="msgTitle" class="col-xs-12 required" value="${notify.msgTitle!}"/>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="beginDate">开始时间:</label>
                                <div class="col-xs-12 col-sm-4">
                                    <div class="clearfix">
                                        <div class="input-medium input-group">
                                            <span style="position: relative; z-index: 9999;">
                                            <input type="text" name="beginDate" id="beginDate" class="input-medium date-picker required" value="${notify.beginStr!}" data-date-format="yyyy-mm-dd"/>
                                            </span>
                                            <span class="input-group-addon"> <i class="ace-icon fa fa-calendar"></i></span>
                                        </div>
                                    </div>
                                </div>
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="endDate">结束时间:</label>
                                <div class="col-sm-4  ">
                                    <div class="clearfix">
                                        <div class="input-medium input-group col-sm-4">
                                            <span style="position: relative; z-index: 9999;">
                                            <input type="text" name="endDate" id="endDate" class="input-medium date-picker" value="${notify.endStr!}" data-date-format="yyyy-mm-dd"/>
                                            </span>
                                            <span class="input-group-addon"> <i class="ace-icon fa fa-calendar"></i></span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">

                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="isLoopPush">是否循环推送:</label>
                                <div class="col-xs-12 col-sm-4">
                                    <div class="clearfix">
                                        <select class="form-control required" name="isLoopPush" id="isLoopPush" data-placeholder="Choose a State...">
                                            <option value="1">是</option>
                                            <option value="0">否</option>
                                        </select>
                                    </div>
                                </div>
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="pushTimePoint">循环推送时间点:</label>
                                <div class="col-sm-4  ">
                                    <div class="clearfix">
                                        <div class="input-group bootstrap-timepicker">
                                            <input  type="text" class="form-control " name="pushTimePoint" id="pushTimePoint"  value="${notify.pushTimePoint!}"> <span
                                                class="input-group-addon"> <i
                                                class="fa fa-clock-o bigger-110"></i>
									        </span>
                                        </div>

                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="loopCycle">循环周期:</label>
                                <div class="col-sm-4  ">
                                    <div class="clearfix">
                                        <select class="form-control" name="loopCycle" id="loopCycle" data-placeholder="Choose a State...">
                                            <option value="0">不循环</option>
                                            <option value="1">每天</option>
                                            <option value="2">每周</option>
                                            <option value="3">每月</option>
                                            <option value="4">工作日</option>
                                        </select>
                                    </div>
                                </div>

                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="createAdminName">创建管理员:</label>
                                <div class="col-sm-4  ">
                                    <div class="clearfix">
                                        <input type="text" name="createAdminName" id="createAdminName"  value="${notify.createAdminName!}" class="col-xs-12 " readonly="" value=""/>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="id">创建时间:</label>
                                <div class="col-sm-4  ">
                                    <div class="clearfix">
                                        <input type="text" name="createTimeShow" id="createTimeShow" class="col-xs-12 " value="${notify.createTimeShow!}" readonly="" />
                                        <input type="hidden" name="createTime" id="createTime" class="col-xs-12 " value="${notify.createTime!}" />
                                    </div>
                                </div>

                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="id">最后修改时间:</label>
                                <div class="col-sm-4  ">
                                    <div class="clearfix">
                                        <input type="text" name="lastModifyTimeShow" id="lastModifyTimeShow" class="col-xs-12 " value="${notify.lastModifyTimeShow!}" readonly=""/>
                                        <input type="hidden" name="lastModifyTime" id="lastModifyTime" class="col-xs-12 " value="${notify.lastModifyTime!}" />
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div>
                                    <label class="control-label col-xs-12 col-sm-2" for="msgDescript">消息简介:</label>
                                    <div class="control-label col-xs-10 col-sm-10 " >
                                        <textarea class=" col-sm-10 required maxlength:500" id="msgDescript"  value="${notify.msgDescript!}" name="msgDescript" maxlength="500">${notify.msgDescript!}</textarea>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>


        <!----消息展示方式-------->
        <div class="row">
            <div class="col-sm-12">
                <div class="widget-box">
                    <div class="widget-header">
                        <h4 class="widget-title">消息展示方式</h4>

                    </div>

                    <div class="widget-body">
                        <div class="widget-main">

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="msgShowType">消息展示方式:</label>
                                <div class="col-sm-4  ">
                                    <div class="clearfix">
                                        <select class="form-control" name="msgShowType" id="msgShowType" data-placeholder="Choose a State...">
                                            <option value="1">普通</option>
                                            <option value="2">Banner</option>
                                        </select>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="id-button-pic">请上传展示图片:</label>
                                <div class="col-xs-8">
                                    <!-- #section:custom/file-input -->
                                    <input type="file" id="id-input-pic" name="picFile"/>
                                </div>
                                <button type="button" id="id-button-pic" class="btn btn-sm btn-success" onclick="uploadPicFile()">
                                    上传 <i class="ace-icon fa fa-arrow-right icon-on-right bigger-60"></i>
                                </button>
                                <input type="hidden" id="picUrl" name="picUrl" value="${notify.picUrl!}">
                                <input type="hidden" id="iconUrl" name="iconUrl" value="${notify.iconUrl!}">
                            </div>
                        </div>
                    </div>

                    <div class="widget-body">
                        <div class="widget-main">
                            <div>
                                <#if notify.msgShowType??>
                                    <#if notify.msgShowType==1>
                                            <a id="pica" name="pica" data-rel="colorbox" href="${notify.iconUrl!}">
                                            <img id="picimg" name="picimg" width="150" src="${notify.iconUrl!}" /></a>
                                        <#else>
                                            <a id="pica" name="pica" data-rel="colorbox" href="${notify.picUrl!}">
                                            <img id="picimg" name="picimg" width="150" src="${notify.picUrl!}" /></a>
                                    </#if>
                                    <#else>
                                        <a id="pica" name="pica" data-rel="colorbox" >
                                            <img id="picimg" name="picimg" width="150" /></a>
                                </#if>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <!----全屏展示管理-------->
        <div class="row">
            <div class="col-sm-12">
                <div class="widget-box">
                    <div class="widget-header">
                        <h4 class="widget-title">全屏展示管理</h4>

                    </div>

                    <div class="widget-body">
                        <div class="widget-main">

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="isFullScreen">是否全屏:</label>
                                <div class="col-sm-4  ">
                                    <div class="clearfix">
                                        <select class="form-control" name="isFullScreen" id="isFullScreen" onchange="changeIsFullScreen(this)" data-placeholder="Choose a State...">
                                            <option value="0">否</option>
                                            <option value="1">是</option>
                                        </select>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group" id="div-fullscreen" hidden>
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="fullScreenImage">请上传全屏推广图:</label>
                                <div class="col-xs-8">
                                    <!-- #section:custom/file-input -->
                                    <input type="file" id="id-input-fullscreenImg" name="fullscreenImgFile"/>
                                </div>
                                <button type="button" id="id-button-fullscreenImg" class="btn btn-sm btn-success" onclick="uploadFullscreenImgFile()">
                                    上传 <i class="ace-icon fa fa-arrow-right icon-on-right bigger-60"></i>
                                </button>
                                <input type="hidden" id="fullScreenImage" name="fullScreenImage" value="${notify.fullScreenImage!}">
                            </div>
                        </div>
                    </div>

                    <div class="widget-body">
                        <div class="widget-main">
                            <div>

                                <#if notify.isFullScreen?? && notify.isFullScreen==1>
                                    <a id="screenpica" name="screenpica" data-rel="colorbox" href="${notify.fullScreenImage!}">
                                        <img id="screenpicimg" name="screenpicimg" width="150"  src="${notify.fullScreenImage!}" /></a>
                                    <#else>
                                        <a id="screenpica" name="screenpica" data-rel="colorbox" >
                                            <img id="screenpicimg" name="screenpicimg" width="150"   /></a>
                                </#if>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!----消息对象管理-------->
        <div class="row">
            <div class="col-sm-12">
                <div class="widget-box">
                    <div class="widget-header">
                        <h4 class="widget-title">消息对象管理</h4>
                    </div>

                    <div class="widget-body">
                        <div class="widget-main">
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="id">消息对象:</label>
                                <div class="col-sm-4  ">
                                    <div class="clearfix">
                                        <select class="form-control" name="msgObj" id="msgObj" onchange="changemsgObj(this)" data-placeholder="Choose a State...">
                                            <option value="-1">请选择类型</option>
                                            <option value="2">软件</option>
                                            <option value="3">专题</option>
                                            <option value="4">分类</option>
                                            <option value="5">外链</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr>
                    <!----软件-------->
                    <div id="softDiv" class="widget-body " hidden>
                        <div class="widget-main">
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="id">应用编号:</label>
                                <div class="col-xs-12 col-sm-3">
                                    <div class="clearfix">
                                        <input type="text" name="softId" id="softId" class="col-xs-12 " />
                                    </div>
                                </div>
                                <label class="control-label col-xs-12 col-sm-1 no-padding-right" for="id">应用名称:</label>
                                <div class="col-sm-3  ">
                                    <div class="clearfix">
                                        <input type="text" name="softName" id="softName" class="col-xs-12 " />
                                    </div>
                                </div>
                                <input type="button" id="searchSoftButton" class="btn btn-sm btn-primary" onclick="resetSoft()" value="查询"/>&nbsp;
                            </div>
                        </div>
                        <div class="widget-main">
                            <table id="softTable" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th width="40" align="center">请选择</th>
                                    <th width="40" align="center">软件ID</th>
                                    <th width="100" align="center">软件名称</th>
                                </tr>
                                </thead>
                                <tbody id="softtbody">
                                <#if checkSofts??>
                                    <#list checkSofts as soft>
                                        <tr>
                                            <td  align="center">
                                                <div class="radio"><label> <input name="softradio" type="radio" class="ace" checked="checked" value="${soft.id!}"/> <span class="lbl"> </span></label></div>
                                            </td>
                                            <td  align="center">${soft.id!}</td>
                                            <td  align="center">${soft.softName!}</td>
                                        </tr>
                                    </#list>
                                </#if>
                                </tbody>
                            </table>
                        </div>
                    </div>

                    <!----外部连接-------->
                    <div id="linkUrlDiv" class="form-group" hidden>
                        <div class="widget-main">
                            <div class="frorm-group">
                                <label class="control-label col-xs-12 col-sm-2" for="linkUrl">外部链接:</label>
                                <div class="col-xs-12 col-sm-4">
                                    <div class="clearfix">
                                        <input type="text" name="linkUrl" id="linkUrl" class="form-control col-sm-4" value="${notify.linkUrl!}"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!----专题-------->
                    <div id="topicDiv" class="widget-body " hidden>
                        <div class="widget-main">
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="id">专题编号:</label>
                                <div class="col-xs-12 col-sm-3">
                                    <div class="clearfix">
                                        <input type="text" name="topicId" id="topicId" class="col-xs-12 "/>
                                    </div>
                                </div>
                                <label class="control-label col-xs-12 col-sm-1 no-padding-right" for="id">专题名称:</label>
                                <div class="col-sm-3  ">
                                    <div class="clearfix">
                                        <input type="text" name="topicName" id="topicName" class="col-xs-12 " />
                                    </div>
                                </div>
                                <input type="button" id="searchTopicButton" class="btn btn-sm btn-primary" onclick="resetTopic()" value="查询"/>&nbsp;
                            </div>
                        </div>
                        <div class="widget-main">
                            <table id="topicTable" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th width="40" align="center">请选择</th>
                                    <th width="40" align="center">专题ID</th>
                                    <th width="100" align="center">专题名称</th>
                                </tr>
                                </thead>
                                <tbody id="topictbody">
                                <#if topics??>
                                    <#list topics.listData as topic>
                                        <tr>
                                            <td  align="center">
                                                <div class="radio"><label> <input name="categoryradio" type="radio" class="ace" checked="checked" value="${topic.id!}"/> <span class="lbl"> </span></label></div>
                                            </td>
                                            <td  align="center">${topic.id!}</td>
                                            <td  align="center">${topic.topicName!}</td>
                                        </tr>
                                    </#list>
                                </#if>
                                </tbody>
                            </table>
                        </div>
                    </div>

                    <!----分类-------->
                    <div id="categoryDiv" class="widget-body " hidden>
                        <div class="widget-main">
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="id">分类名:</label>
                                <div class="col-xs-12 col-sm-3">
                                    <div class="clearfix">
                                        <input type="text" name="categoryName" id="categoryName" class="col-xs-12 "/>
                                    </div>
                                </div>
                                <input type="button" id="searchCatetoryButton" class="btn btn-sm btn-primary" onclick="resetCatagory()" value="查询"/>&nbsp;
                            </div>
                        </div>
                        <div class="widget-main">
                            <table id="categoryTable" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th width="40" align="center">请选择</th>
                                    <th width="40" align="center">分类ID</th>
                                    <th width="40" align="center">分类层级</th>
                                    <th width="40" align="center">分类名称</th>
                                </tr>
                                </thead>
                                <tbody id="categorytbody">
                                <#if categories??>
                                    <#list categories.listData as category>
                                        <tr>
                                            <td  align="center">
                                                <div class="radio"><label> <input name="categoryradio" type="radio" class="ace" checked="checked" value="${category.id!}"/> <span class="lbl"> </span></label></div>
                                            </td>
                                            <td  align="center">${category.id!}</td>
                                            <td  align="center">${category.level!}</td>
                                            <td  align="center">${category.categoryName!}</td>
                                        </tr>
                                    </#list>
                                </#if>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="clearfix form-actions">
            <div class="col-md-offset-4 col-md-9">
                <button class="btn btn-info" type="button" onclick="submitNotify()">
                    <i class="ace-icon fa fa-check bigger-110"></i> 确定
                </button>
                &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;
                <button class="btn" type="button" onclick="window.location='${refer!}';">
                    <i class="ace-icon fa fa-undo bigger-110"></i> 取消
                </button>
            </div>
        </div>
    </form>
    </@mainlayout>
<script src="${ctx}/static/admin/assets/js/jquery.validate.js"></script>
<script src="${ctx}/static/admin/assets/js/jquery.validate.messages_zh.js"></script>
